<?php
namespace app\index\controller;
use think\Controller;

class Index extends Controller
{
    public function index(){

        return $this->fetch();

    }

    public function checkCode(){

        $code = $_POST['captcha'];
        var_dump($code);exit;

        if( empty($code) ){ //我故意检查一下$code是否为空，居然真的为空！～～

            if(!captcha_check($code)){

                $ret = 0;

            } else {

                $ret = 1;

            }
            return json_encode($ret);
        }
    }

}
